package com.demon.net

import java.lang.Exception

/**
 * <p>
 * [类说明]
 * </p>
 *
 * @author zhaozeyang
 * @since 2020/4/10
 */
sealed class ResponseResult<out T : Any> {
    data class Success<out T : Any>(val data: T?) : ResponseResult<T>()
    data class SuccessResponse<out T : Any>(val data: T?, val response: IAppResponse<out T>) :
        ResponseResult<T>()

    data class Expired(val message: String? = null) : ResponseResult<Nothing>()
    data class Failed(val exception: ApiError) : ResponseResult<Nothing>()
    data class HttpError(val exception: Exception) : ResponseResult<Nothing>()
}